﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.ViewModel;
using System.Windows.Input;
using CatalogModule.Commands;
using System.Windows;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Events;
using Infrastructure.Events;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;

namespace CatalogModule.ViewModels
{
    /// <summary>
    /// ViewModel for CatalogManagerMenuView.
    /// </summary>
    public class CatalogManagerMenuViewModel : NotificationObject
    {

        #region Fields
        IEventAggregator eventAggregator;
        IUnityContainer container;
        IRegionManager regionManager;

        // Property variables
        #endregion

        #region Constructor
        /// <summary>
        /// Default constructor.
        /// </summary>
        public CatalogManagerMenuViewModel(IEventAggregator eventAggregator, IRegionManager regionManager, IUnityContainer container)
        {
            this.container = container;
            this.eventAggregator = eventAggregator;
            this.regionManager = regionManager;
            this.Initialize();

            this.ShowDonViViewCommand = container.Resolve<ShowDonViViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowDonViViewCommand>()
            );
            this.ShowKhoaHocViewCommand = container.Resolve<ShowKhoaHocViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowKhoaHocViewCommand>()
            );
            this.ShowLopViewCommand = container.Resolve<ShowLopViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowLopViewCommand>()
            );
            this.ShowMonHocViewCommand = container.Resolve<ShowMonHocViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowMonHocViewCommand>()
            );
            this.ShowVanBangViewCommand = container.Resolve<ShowVanBangViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowVanBangViewCommand>()
            );
            this.ShowDoanTheViewCommand = container.Resolve<ShowDoanTheViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowDoanTheViewCommand>()
            );
            this.ShowCauLacBoViewCommand = container.Resolve<ShowCauLacBoViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowCauLacBoViewCommand>()
            );
            this.ShowTonGiaoViewCommand = container.Resolve<ShowTonGiaoViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowTonGiaoViewCommand>()
            );
            this.ShowDanTocViewCommand = container.Resolve<ShowDanTocViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowDanTocViewCommand>()
            );
            this.ShowDVHCViewCommand = container.Resolve<ShowDVHCViewCommand>(
                new ParameterOverrides 
                {
                    {"viewModel", this}
                }.OnType<ShowDVHCViewCommand>()
            );
        }
        #endregion

        #region Command Properties
        public ICommand ShowDonViViewCommand { get; set; }
        public ICommand ShowKhoaHocViewCommand { get; set; }
        public ICommand ShowLopViewCommand { get; set; }
        public ICommand ShowMonHocViewCommand { get; set; }
        public ICommand ShowVanBangViewCommand { get; set; }
        public ICommand ShowDoanTheViewCommand { get; set; }
        public ICommand ShowCauLacBoViewCommand { get; set; }
        public ICommand ShowTonGiaoViewCommand { get; set; }
        public ICommand ShowDanTocViewCommand { get; set; }
        public ICommand ShowDVHCViewCommand { get; set; }
        #endregion

        #region Administrative Properties
        public IRegionManager RegionManager
        {
            get { return regionManager; }
        }

        public IEventAggregator EventAggregator
        {
            get { return eventAggregator; }
        }

        public IUnityContainer Container
        {
            get { return container; }
        }
        #endregion

        #region Event Handlers

        #endregion

        #region Private Methods
        /// <summary>
        /// Initializes the view model.
        /// </summary>
        private void Initialize()
        {
            // Initialize the UI properties
        }
        #endregion
    }
}
